important to add the following in .zshrc or .bashrc:
export GPG_TTY=$(tty)
